#ifndef __WEB_PAGR_H__
#define __WEB_PAGR_H__
#include "SplitToolJieba.h"
#include "Configuration.h"
#include <string>
#include<iostream>
#include"nlohmann/json.hpp"

using std::string;
using std::ostream;

class WebPage
{
public:
    WebPage(const int docid, const string &title, const string &trl, const string &content);
    WebPage(const string &article);
    int getDocid();
    string getDoc();
    friend void to_json(nlohmann::json& j,const WebPage& we);
    friend void from_json(const nlohmann::json & j , WebPage& we);

friend ostream& operator<<( ostream& os ,const WebPage& rhs);
private:
    void putDoc();
    void init();

private:
    string _doc;
    int _docid;
    string _docTitle;
    string _docUrl;
    string _docConten;
};

#endif
